﻿using FeatureDemo.Helper;
using Microsoft.Phone.Controls;
using System;
using Microsoft.Phone.Shell;
using System.Linq;

namespace FeatureDemo.Features.LiveTiles
{
    [Feature("Background", "How to create and update a Live Tile Background", 7.5)]
    public partial class LiveTileBackgroundPage : PhoneApplicationPage
    {
        public LiveTileBackgroundPage()
        {
            InitializeComponent();
        }

        private void _update_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Random rnd = new Random();
            StandardTileData data = new StandardTileData
            {
                BackTitle = "Background Text"
            };

            ShellTile defaultTile = ShellTile.ActiveTiles.First();
            defaultTile.Update(data);

        }
    }
}